#include <stdio.h>

long factorial_recursive(int n)
{
    if (n == 0 || n == 1)
    {
        return 1;
    }
    return n * factorial_recursive(n - 1);
}

int main()
{
    int n;
    printf("请输入一个正整数：");
    scanf("%d", &n);

    if (n < 0)
    {
        printf("请输入非负整数！\n");
    }
    else
    {
        printf("%d! = %ld \n", n, factorial_recursive(n));
    }

    return 0;
}